package com.roncoo.course.controller;


import com.roncoo.course.entity.CourseIntroduce;
import com.roncoo.course.service.CourseIntroduceService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wdf
 * @since 2021-04-07
 */
@Controller
@RequestMapping("/courseIntroduce")
public class CourseIntroduceController {

    @Resource
    private CourseIntroduceService courseIntroduceService;
    /**
     * 根据id查询数据
     */
    @GetMapping("findById")
    @ResponseBody
    public CourseIntroduce findById(Integer id){
        return courseIntroduceService.getById(id);
    }

    @PostMapping("addCourseIntroduce")
    @ResponseBody
    public Integer addCourseIntroduce(CourseIntroduce courseIntroduce){
        Integer introduce = courseIntroduceService.addCourseIntroduce(courseIntroduce);
        return introduce;
    }
}

